import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.*;


public class test {
    public static void main(String[] args) throws IOException {
       Scanner scan=new Scanner(System.in);

                for (int i = 0; i < 10; i++) {
                    System.out.println("随机验证码："+fun());
                }
            }
            public static String fun(){
                String str = "";
                char[] ch = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
                        'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
                        'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
                Random random = new Random();
                for (int i = 0; i < 6; i++) {
                    char num = ch[random.nextInt(ch.length)];
                    str += num;

                }
                return str;



/*
        String[] provinces = {"黑龙江省", "浙江省", "江西省", "广东省", "福建省"};
        String[] cities = {"哈尔滨", "杭州", "南昌", "广州", "福州"};
        Map<String, String> map = new HashMap<>();
        for (int i = 0; i < provinces.length; i++) {    map.put(provinces[i], cities[i]);}System.out.println(map);




/*
        List<Student> list=new ArrayList<>();
        //创建10个学生类对象并通过有参构造传递学生信息
        Student s1=new Student("张三",25,96);
        Student s2=new Student("蕾蕾",21,89);
        Student s3=new Student("张雷",26,92);
        Student s4=new Student("赵琳",23,99);
        Student s5=new Student("张硕",22,95);
        Student s6=new Student("宋轶",29,94);
        Student s7=new Student("黄吉",22,93);
        Student s8=new Student("雷米",23,92);
        Student s9=new Student("张思",28,91);
        Student s10=new Student("赵明",26,90);
        //把学生对象都添加到list集合中
        list.add(s1);
        list.add(s2);
        list.add(s3);
        list.add(s4);
        list.add(s5);
        list.add(s6);
        list.add(s7);
        list.add(s8);
        list.add(s9);
        list.add(s10);
        //使用list集合的迭代器进行遍历  使用其他遍历方式也可
        Iterator<Student> iterator = list.iterator();
        //初始化sum，用来接收姓张同学的总分
        double sum=0;
        //初始化人数
        int num=0;
        //循环遍历
        while(iterator.hasNext()){
            //获取每次遍历得出的学生对象
            Student next = iterator.next();
            //使用getName方法获取名字，startWith判断字符串是否以张为开头
            if(next.getName().startsWith("张")){
                //为张开头的名字进入，让num值加1，sum+=计算总分
                num++;
                sum+=next.getGoals();
            }
        }
        //计算最终的平均分
        double avg=sum/num;
        System.out.println("姓张的平均分为："+avg);






       /*  FileOutputStream fos=new FileOutputStream("calcCharNum.txt");
        OutputStreamWriter osw=new OutputStreamWriter(fos, StandardCharsets.UTF_8);
        String use=scan.next();
        osw.write(use);
        System.out.println("输入数据为："+use);
        osw.close();


        FileInputStream fis=new FileInputStream("calcCharNum.txt");
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        //
        byte[] buf = new byte[8];
        int len;
        int m = 0;
        int n = 0;
        while ((len = fis.read(buf)) != -1) {
            os.write(buf, 0, len);
        }
        byte[] arr = os.toByteArray();
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] == 'A') {
                ++m;
            }
            if (arr[i] == 'a') {
                ++n;
            }
        }

        System.out.println("A的个数：" + m);
        System.out.println("a的个数：" + n);




        os.close();


         /*
            int A = 0,a=0,nm = 0;
            String str = scan.next();
            for(int i = 0;i < str.length();i++){
                if(str.charAt(i) >= 'A' && str.charAt(i) <= 'Z')
                    A++;
                else if(str.charAt(i) >= 'a' && str.charAt(i) <= 'z')
                    a++;
                else if(str.charAt(i) >= '0' && str.charAt(i) <= '9')
                    nm++;
            }
            System.out.println("大写字母个数：" + A );
            System.out.println("小写字母个数：" + a );
            System.out.println("数字个数：" + nm );




/*

                for(int i=0;i<3;i++) {
                    System.out.println("请输入用户名：");
                    String username=scan.next();
                    System.out.println("请输入密码：");
                    String pwd=scan.next();
                    if("admin".equals(username)&&"admin".equals(pwd)) {
                        System.out.println("登录成功");
                        break;
                    }else {
                        System.out.println("登录失败");
                        int count=3-i-1;
                        if(count==0) {
                            System.out.println("你没有机会了");
                        }else {
                            System.out.println("你还有"+(3-i-1)+"次机会，请重新输入");
                        }
                    }
                }

                sc.close();







/*
            String str1 = "车臣恐怖分子计划利用爆炸摧毁政府的军火库。";
            String[] str = {"恐怖","爆炸","军火"};
            for(String s:str) {
                str1 = str1.replace(s, "");
            }
            System.out.println(str1);




        /*
            String str1="qazWSX";
            String str2="aaaaAAA";
            char[] x=str1.toCharArray();
            char[] y=str2.toCharArray();
        for (int i=0;i<x.length;i++){
                if (Character.isUpperCase(x[i])){
                x[i]=Character.toLowerCase(x[i]);
             }else if (Character.isLowerCase(x[i])){
                 x[i]=Character.toUpperCase(x[i]);
             }
}
        System.out.println(x);
        for (int i=0;i<y.length;i++){
            if (Character.isUpperCase(y[i])){
                y[i]=Character.toLowerCase(y[i]);
            }else if (Character.isLowerCase(y[i])){
                y[i]=Character.toUpperCase(y[i]);
            }
        }

        System.out.println(y);
            String x1=String.valueOf(x);
            String y1=String.valueOf(y);
            String a=x1+y1;
        System.out.println(a);






      /*  ArrayList arr=new ArrayList();
        int sum = 0;
        int use;
        System.out.println("输入一些1~100之间的整数，并添加到集合中，直到集合中所有数据和超过200为止");
        while (sum<200){

             for (int i=0;i<=100;i++){
                 System.out.println("请输入:");
                 use=scan.nextInt();
            if (use>0&&use<=100){
                 arr.add(i,use);
                sum+=use;
                break;
            }else {
                System.out.println("输入错误,重新输入");
                break;
            }
             }
        }
        System.out.println("所有数据和为："+sum);

       */
    }
}
